<?php
class  Front_Model_DbTable_Cv  extends  Kieumau_Db_Common
{
    protected $_name = 'cv' ;
    
    public function validateEditPermission($idCv, $employeeId)
    {
    	try {
			$sql = 'SELECT count(*) as quantity
					FROM cv
					WHERE id = ? AND employee_id = ?';
			$this->_db->setFetchMode(Zend_Db::FETCH_ASSOC);
			$result = $this->_db->fetchAll ( $sql, array($idCv, $employeeId ));
			return $result[0]['quantity'];
		} catch ( Exception $ex ) {
			echo "<br/> Can not validate permission to edit CV, <br/>Error: " . $ex->getMessage ();
			exit ();
		}
    }
	
	
	   
}
